package com.huike.clues.service.impl;


import com.huike.clues.domain.TbClue;
import com.huike.clues.domain.TbClueTrackRecord;
import com.huike.clues.mapper.TbClueMapper;
import com.huike.clues.mapper.TbClueTrackRecordMapper;
import com.huike.clues.service.ITbClueTrackRecordService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 线索跟进记录Service业务层处理
 * @date 2022-04-22
 */
@Service
public class TbClueTrackRecordServiceImpl implements ITbClueTrackRecordService {
    @Autowired//依赖注入跟进表mapper
    private TbClueTrackRecordMapper tbClueTrackRecordMapper;
    @Autowired//依赖注入线索表mapper
    private TbClueMapper tbClueMapper;

//查询线索跟进表
    @Override
    public List<TbClueTrackRecord> list(Long clueId) {
return tbClueTrackRecordMapper.list(clueId);

    }

    //新增线索跟进记录
    @Override
    public void add(TbClueTrackRecord tbClueTrackRecord, TbClue tbClue) {
//1.向线索跟进表新增数据
        tbClueTrackRecordMapper.insert(tbClueTrackRecord);
//        2.向线索表更新数据
        tbClueMapper.updateTbClue(tbClue);
    }
}
